package com.example.springbootmybatis.controller;
import com.example.springbootmybatis.entity.Client;
import com.example.springbootmybatis.mapper.ClientMapper;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
    @Resource
    ClientMapper clientMapper;
@GetMapping("/selectByid")
    public Client  selectByid(String id){
    Client client=clientMapper.findByid(id);
    return client;
}
    @GetMapping("/register")
    public int register(Client client){
    clientMapper.register(client);
        return 1;
    }
    @GetMapping("/modifyByid")
    public int modifyByid(Client client){
        clientMapper.modifyByid(client);
        return 1;
    }
    @GetMapping("/deleteByid")
    public int deleteByid(Client client){
        clientMapper.deleteByid(client);
        return 1;
    }
}